<template>
	<view>
		<view class="dm-page">
			<image class="dm-bg-img" src="https://duomi.bigchun.com/images/vip/dm-bg-1.png" mode="widthFix"></image>
			<view class="from-dm-box">
				<view class="from-title">卡密绑定</view>
				<view class="label-ipt">
					<view class="ipt-label-name">卡号</view>
					<view class="ipt-input">
						<input type="password" v-model="camiloNum" placeholder="请输入卡号">
					</view>
				</view>
				<view class="from-btn" @click="camiloBtnChange">激活本卡</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				camiloNum: ''
			}
		},
		methods: {
			camiloBtnChange() {
				let { camiloNum } = this;
				uni.showLoading()
				if (!camiloNum.length) return uni.showToast({title: '请输入卡号', icon: 'none'})
				this.$https('vip.useCamilo', {
					camilo: camiloNum
				}).then(res => {
					uni.hideLoading()
					if (res.code) {
						uni.showToast({
							title: '激活成功',
							icon: 'success'
						})
						setTimeout(() => uni.navigateBack(), 1500)
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.dm-page {
	width: 100vw;
	height: 100vh;
	background: #EB5848;
	.dm-bg-img {
		width: 100%;
	}
	.from-dm-box {
		width: 702rpx;
		height: 588rpx;
		background: white;
		border-radius: 16rpx;
		position: relative;
		left: 50%;
		transform: translateX(-50%);
		top: -40rpx;
		padding: 0 40rpx;
		box-sizing: border-box;
		.from-title {
			font-size: 32rpx;
			color: #333333;
			font-weight: bold;
			text-align: center;
			line-height: 136rpx;
			margin-bottom: 22rpx;
		}
		.label-ipt {
			.ipt-label-name {
				font-size: 28rpx;
				color: #777777;
				font-weight: 500;
				margin-bottom: 22rpx;
			}
			.ipt-input {
				width: 100%;
				height: 96rpx;
				background: #F8F8F8;
				border-radius: 8rpx;
				padding: 30rpx 56rpx;
				input {
					font-size: 26rpx;
				}
			}
		}
		.from-btn {
			width: 100%;
			height: 88rpx;
			background: #E64F40;
			border-radius: 74rpx;
			margin: 60rpx auto 0;
			font-size: 32rpx;
			color: white;
			font-weight: bold;
			text-align: center;
			line-height: 88rpx;
		}
	}
}
</style>
